package Test;

import java.util.Arrays;

class Person implements Cloneable{

    public String name;
    public int age;

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
class Student /*implements Comparable <Student>*/{



    public String name;
    public int score;

    public Student(String name, int score) {
        this.name = name;
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", score=" + score +
                '}';
    }
}
public class Test {
    public static void main(String[] args) throws CloneNotSupportedException {
        Person person=new Person("vds",44);
        Person person1=(Person)person.clone();

        System.out.println(person);
        System.out.println(person1);

    }
    public static void main1(String[] args) {

        Student[] students=new Student[3];
        students[0]=new Student("niaho",44);
        students[1]=new Student("ddd",55);
        students[2]=new Student("rrw",56);
        NameComparator nameComparator=new NameComparator();
        Arrays.sort(students,nameComparator);
        System.out.println(Arrays.toString(students));


    }
}
